#include <string.h>
#include <stdlib.h>

char **list_init() {
   char **retval = NULL;
   retval = malloc(sizeof(char *));
   memset(retval,0,sizeof(char*));
   retval[0]=0x0;
   return retval;
}

char **list_append(char **list, char *word) {
   char **retval;
   int len=0;
   while(list[len]) len++;
   len++;
   retval=realloc(list,(len+1)*sizeof(char*));
   retval[len]=NULL;
   retval[len-1]=strdup(word);
   return retval;
}

void clean_list(char **list) {
   int i=0;
   while(list[i]) {
      free(list[i]);
      i++;
   }
}
